package com.visionblue.business.ship.model.repository.db

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey
import com.visionblue.business.ship.model.enums.WasteTypeEnum
import com.visionblue.business.ship.page.collection.panel.flow.FlowViewLayout
import com.visionblue.business.ship.page.register.config.*

/**
 * @author: xlh
 * @date: 2020-07-21 3:55 PM
 * @desc:
 */
@Entity(tableName = "measure_menu_items")
data class MeasureMenuItem(
    @ColumnInfo val name: String,
    @ColumnInfo var alias: String? = null,
    @ColumnInfo var isChecked: Boolean = true,
    @ColumnInfo val isOutput: Boolean = false,
    @PrimaryKey(autoGenerate = true) val id: Long? = null
) {

    @Ignore var state: Int = FlowViewLayout.WORKING
    @Ignore var flowRate: Double = 0.0
    @Ignore var speedUnit: String = ""

    fun isFlow() = name == WATER_VOLUME_NAME || name == OIL_VOLUME_NAME || name == ULTRASONIC_NAME||name == WATER_VOLUME_NAME2

    fun isWater() = name == WATER_VOLUME_NAME

    fun isOil() = name == OIL_VOLUME_NAME

    fun isSolid() = name == WEIGHT_NAME

    fun isUltraSonic() = name == ULTRASONIC_NAME

    fun isWasteWater() = name == WATER_VOLUME_NAME2
}